<html">
<head>
    <meta charset="UTF-8">
    <title>注册页面</title>
	<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
	<style>
		#a{
			font-size: 50%;
			color:black;
			text-decoration: none;
		}
	</style>
</head>
<body>
		账号:<input type="text" id="name" placeholder="请输入账号" name="username"><br><br>
		密码:<input type="password" id="pwd" placeholder="请输入密码" name="password"><br><br>
		<input type="submit" onclick="sub()" value="提交">    <br><br>
		<a href="http://localhost:8888/html/index2.html" target="_self" id="a">返回登录</a>
	 <script>
		function sub(){
			var name=$("#name").val();
			var pwd=$("#pwd").val();
			var user={
					username:name,
					password:pwd
			}
			$.post("http://localhost:8888/boot2/register",{"data":JSON.stringify(user)},function (data){
				alert(data);
				if(data==="注册成功，请返回登录...")
					window.open("http://localhost:8888/html/index2.html")
				window.location.reload();
			})
		}
	 </script>
</body>
</html>